Skip to content

fix(wokwi): support wokwi-client 0.4.0#403

Merged
hfudev merged 2 commits intomainfrom
fix/wokwi-firmware
Feb 26, 2026
Merged

fix(wokwi): support wokwi-client 0.4.0#403
hfudev merged 2 commits intomainfrom
fix/wokwi-firmware

Conversation

@hfudev
Copy link
Copy Markdown
Member

@hfudev hfudev commented Feb 26, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the pytest-embedded-wokwi plugin to support wokwi-client version 0.4.0 by adapting to the new API and removing deprecated version checking code.

Changes:

  • Updated wokwi-client dependency from >=0.2.0 to >=0.4.0
  • Removed version compatibility checking code and WOKWI_CLI_MINIMUM_VERSION constant
  • Updated file upload and simulation initialization to use new wokwi-client 0.4.0 API methods

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pytest-embedded-wokwi/pyproject.toml Updated wokwi-client minimum version requirement from 0.2.0 to 0.4.0
pytest-embedded-wokwi/pytest_embedded_wokwi/init.py Removed WOKWI_CLI_MINIMUM_VERSION constant and cleaned up import statements
pytest-embedded-wokwi/pytest_embedded_wokwi/wokwi.py Removed version checking logic and packaging import; updated API calls to use Path objects and new upload_idf_firmware method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hfudev
Copy link
Copy Markdown
Member Author

hfudev commented Feb 26, 2026

Hi @urish I noticed errors like https://github.com/espressif/pytest-embedded/actions/runs/22448984330/job/65011684261#step:6:12904 since wokwi-client 0.4.0 released.

  /usr/local/lib/python3.14/site-packages/wokwi_client/transport.py:140: RuntimeWarning: Background recv error: Server error 1: Firmware file pytest.bin appears to contain source code, not compiled firmware. See: https://docs.wokwi.com/vscode/migrating

This PR is to fix the upload. PTAL, thanks.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 26, 2026

Title Coverage Tests Skipped Failures Errors Time
Qemu Coverage 7 0 💤 0 ❌ 0 🔥 25.166s ⏱️
3.14 X64 Coverage 103 14 💤 0 ❌ 0 🔥 14m 1s ⏱️
3.10 ARM64 Coverage 103 16 💤 0 ❌ 0 🔥 11m 38s ⏱️

@urish
Copy link
Copy Markdown
Contributor

urish commented Feb 26, 2026

@hfudev and was the .bin file actually a compiled firmware file? or something like flasher_args.json?

@hfudev
Copy link
Copy Markdown
Member Author

hfudev commented Feb 26, 2026

@hfudev and was the .bin file actually a compiled firmware file? or something like flasher_args.json

firmware_path = Path(flasher_args).as_posix()

I think it's path to the flasher_args.json

@urish
Copy link
Copy Markdown
Contributor

urish commented Feb 26, 2026

But you are calling upload_idf_firmware(), so it should handle that for you: https://github.com/wokwi/wokwi-python-client/blob/419d9d45cac33e464fc6f082b98768f90f2fbebb/src/wokwi_client/idf.py#L36

Do you still get this error when using upload_idf_firmware()?

@hfudev hfudev force-pushed the fix/wokwi-firmware branch from 72b5f35 to 560ca69 Compare February 26, 2026 18:47
@hfudev hfudev force-pushed the fix/wokwi-firmware branch from 560ca69 to 6dbc86c Compare February 26, 2026 18:48
@hfudev
Copy link
Copy Markdown
Member Author

hfudev commented Feb 26, 2026

@urish after the first try, I got different errors. Now I understand the problem better.

arduino and idf has different layout. arduino firmware_path points to the .bin file, and idf firmware_path points to the flasher_args.json.

The tests passed locally. PTAL 6dbc86c. Thank you.

@hfudev hfudev merged commit 6e9d666 into main Feb 26, 2026
6 checks passed
@hfudev hfudev deleted the fix/wokwi-firmware branch February 26, 2026 19:10
@urish
Copy link
Copy Markdown
Contributor

urish commented Feb 26, 2026

The tests passed locally. PTAL 6dbc86c. Thank you.

Added two comments for the commit:

  1. passing flash size to start_simulation (i.e. self.client.start_simulation(firmware.firmware, elf='pytest.elf', flash_size=firmware.flash_size))
  2. The "Starting simulation..." message is actually printed after simulation has already started (cosmetic)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants